<template>
  <div class="page_body">
    <HomeTop :topTitle="topTitle"></HomeTop>

    <div class="check_system_body">
      <div
        class="check_system_list"
        v-for="(item, index) in categorylist"
        :key="index"
      >
        <!-- <div class="check_system_list_title">{{ item.title }}</div> -->
        <img
          class="check_system_list_img"
          :src="item.image_path"
          @click="toOther(item)"
        />
      </div>
    </div>
  </div>
</template>
<style src="../../assets/css/game/currentGame.css" scoped></style>

<script>
import { Toast } from "mint-ui";
import HomeTop from "@/components/homeTop.vue";
import HomeFooter from "../../components/homeFooter.vue";

export default {
  name: "gameCenter",
  components: {
    HomeTop,
  },
  data() {
    return {
      topTitle: "篮球赛事", // 顶部组件参数设置
      categorylist: [],
      id: "",
    };
  },
  mounted() {
    this.categoryList();
  },
  // created(){},
  methods: {
    toOther(item) {
      this.id = item.id;
      sessionStorage.setItem("event_id", this.id); //赛事类型ID
      if (this.id == "2") {
        this.$router.push({
          name: "childrenGroup",
          query: {
            id: item.id,
            image_path: item.image_path,
          },
        });
      } else {
        Toast({
          message: "暂无开放",
          duration: 3000,
        });
      }
    },
    categoryList() {
      let url = "/mobile/categoryList";
      // let data = {};
      this.axios.post(url).then((res) => {
        if (res.code == 0) {
          this.categorylist = res.category;
        } else {
          Toast({
            message: res.msg,
            duration: 3000,
          });
        }
      });
    },

    // toHome() {},
    // toRefereeHome() {},
    // toMainUserCenter() {},
  },
};
</script>
